def outer():
    name = "jack"
    def inner():
        nonlocal name
        name = "tom"
    inner()
    print(name)
    
outer()